package com.ruoyi.common.exception;

import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value = AppUnWorkTokenException.class)
    @ResponseBody
    public AjaxResult AppUnWorkTokenExceptionHandler(AppUnWorkTokenException e){
        return new AjaxResult(401, e.getMessage());
    }
}
